<?
include_once('../conn.php');
$site = 'http://www.parismemo.com/shop/';
if($_POST){
	$fp= fopen('paypalapi/config.txt', "w+");
	fwrite($fp, $_POST[business].'::'.$_POST[currency_code].'::'.$_POST[mc_fee]);
	fclose($fp);
	header("Location: $nowpage");
	}
	
if(isset($_GET[del])){
	$deldate1 = $db->DELETE("DELETE FROM `".tablepre."paypal` WHERE (`pid`='$_GET[del]')");
	header("Location: $nowpage");
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hold Yes Zencart Module</title>
<script type="text/javascript">
function trnull(s){
	s.style.backgroundColor="";
	}
function tr1(s){
	s.style.backgroundColor="#EFEFEF";
	}
</script>
<style>
body{
	font-size:12px;}
.btn1{
	margin:5px; border:solid #CCC 1px; padding:5px;}</style>
</head>

<body>
<?


include_once('../include/encryption.php');
eval(@encryption('732d0n49Duv+ky95xAXs1Oz3Qf2XvfHjodb93OtpaOG/SHk9NvrOTNUWXa+eThilotpK6yzWIU7ASTORRYU04i4auCr2+ZvA8SatXcBz7ZJViFgt6mEPW4Ivlf5p7NHqODGIabHLzmBZMBQmJIohzedThNecF6eNT3iHNgdyVP6t/Za+am8RbhhQwPWLMypgoEax/YHwEKePkHnB+zk+X/Jk8G78l9XX8Hl8QxL6USE4aDeLSSXXunA5BmbwaZDZwWyDQqidw1on5nwUPEEZMG1OB/q6sa1Y','DECODE'));



?>

<?
if(!is_file('paypalapi/config.txt')){
	echo '你还没正常设置PayPal<br />';
	}else{
		$fp= fopen('paypalapi/config.txt', "r");
		$contents = fread($fp, 1024);
		$v_arr=explode('::',$contents);
		fclose($fp);
		}
$currency_code=array("USD","EUR","GBP","CAD","JPY");

?>
<form action="" method="post">
PayPal ID： 
  <input name="business" type="text" value="<? echo $v_arr[0]; ?>" size="40" />
货币：
<select name="currency_code">
<? 
echo '<option value="'.$v_arr[1].'">'.$v_arr[1].'</option>';
foreach($currency_code as $v){
	echo '<option value="'.$v.'">'.$v.'</option>';
	}?>
  
</select> 
<br />
手续费：
<input name="mc_fee" type="text" value="<? echo $v_arr[2]; ?>" size="5" >
<input type="submit" name="button" id="button" value="提交" />
</form><br />
<table width="850" border="0" cellspacing="2" cellpadding="2" style="border:#CCC solid 1px;">
  <tr>
    <td bgcolor="#CCCCCC">ID</td>
    <td bgcolor="#CCCCCC">支付状态</td>
    <td bgcolor="#CCCCCC">支付时间</td>
    <td bgcolor="#CCCCCC">完成支付时间</td>
    <td bgcolor="#CCCCCC">价钱</td>
    <td bgcolor="#CCCCCC">支付ID</td>
    <td bgcolor="#CCCCCC">名字</td>
    <td bgcolor="#CCCCCC">手续费</td>
    <td bgcolor="#CCCCCC">删除</td>
  </tr>
  <?
 $pay_note = $db->select("SELECT * FROM `".tablepre."paypal` order by pid desc");
	for($i=0;$i<count($pay_note);$i++){
		$payment_status = $pay_note[$i][2]==null?'未支付':$pay_note[$i][2];
		$fee = $pay_note[$i][6] < 1 ?'':$pay_note[$i][6].' '.$pay_note[$i][5];
		$delete = $pay_note[$i][2]==null?'<a href="?del='.$pay_note[$i][0].'" onclick="return confirm(\'注意！删除后不能恢复！确定删除？\')">删除</a>':'';
		echo '<tr onmouseover="tr1(this)" onmouseout="trnull(this);">
    <td>'.$pay_note[$i][1].'</td>
    <td>'.$payment_status.'</td>
    <td>'.$pay_note[$i][10].'</td>
    <td>'.$pay_note[$i][23].'</td>
    <td>'.$pay_note[$i][3].' '.$pay_note[$i][5].'</td>
    <td>'.$pay_note[$i][9].'</td>
    <td>'.$pay_note[$i][19].' '.$pay_note[$i][18].'</td>
	<td>'.$fee.'</td>
	<td>'.$delete.'</td>
    </tr>';
	}
 ?></table>
</body>
</html>
